using Core.Domain.Entities;
using FluentNHibernate.Mapping;

namespace DataMain.Mappings
{
  public class BallotMap : ClassMap<Ballot>
  {
    public BallotMap()
    {
      Id(x => x.Id);
      Map(x => x.Code).Not.Nullable().WithLengthOf(15);
      Map(x => x.BallotStatus).Not.Nullable();
      HasMany(x => x.Votes);
      References(x => x.InBallotSet);
      References(x => x.EnteredAtLocation);
      References(x => x.EnteredByTeller);
      References(x => x.EnteredByTellerAssistant);
      References(x => x.EnteredWithComputer);
    }
  }
}